package com.baidb.service2.ribbon;

/**
 * @author baidb
 * @date 2021/6/16.
 */
public class RibbonFilterContextHolder {

    private static final ThreadLocal<RibbonFilterContext> contextHolder =
        new InheritableThreadLocal<RibbonFilterContext>() {
            @Override
            protected RibbonFilterContext initialValue() {
                return new RibbonFilterContext();
            }
        };

    public static RibbonFilterContext getCurrentContext() {
        return contextHolder.get();
    }

    public static void clearCurrentContext() {
        contextHolder.remove();
    }

}
